package cn.thr.ymcc.client;

import cn.thr.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaClientFallbackFactory implements FallbackFactory<MediaClient> {
    @Override
    public MediaClient create(Throwable throwable) {
        throwable.printStackTrace();
        return new MediaClient() {
            @Override
            public JsonResult loadAllByCourseId(Long courseId) {
                throwable.printStackTrace();
                return JsonResult.error("媒体中心 loadAllByCourseId 接口调用失败"+throwable.getMessage());
            }
        };
    }
}
